import { createStore } from 'redux'
const defaultState = { 
  list: [1, 2, 3],
  loginState: false
}
const reducer = (state = defaultState, { type, payload }) => {
  switch (type) {
    case 'CHANGE_LIST':
      return { ...state, list: payload }
    case 'CHANGE_LOGIN_STATE':
      return { ...state, loginState: payload }
    default:
      return state
  }
}

const store = createStore(reducer)

export default store